﻿using System;
using System.Collections.Generic;
using System.Text;

namespace BlockMain_Class
{
   public static class ToDate
    {
        public static DateTime To(string timespan)
        {
            long jsTimeStamp = Convert.ToInt64(timespan);
            System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
            DateTime dt = Convert.ToDateTime(startTime.AddMilliseconds(jsTimeStamp).ToString("yyyy-MM-dd HH:mm:ss")).AddHours(-8);
            return dt;
        }
    }
}
